package com.fanbai.score.user.activity;

import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import com.fanbai.score.R;
import com.fanbai.score.common.Manager.ActivityManager;
import com.fanbai.score.common.Utils.AppUtils;
import com.fanbai.score.common.Utils.pop.PopListWin;
import com.fanbai.score.common.base.BaseActivity;

import java.util.Arrays;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by acer on 2017/5/14.
 * 编辑以及新增银行卡信息
 */

public class EditBankCard_Activity extends BaseActivity{

    private PopListWin popListWin;

    @BindView(R.id.userActivityEditBankCard_bank)
    TextView bankName;

    @OnClick(R.id.userActivityEditBankCard_bank)
    public void onClickBankName(){
        if (popListWin == null){
            popListWin = new PopListWin(ctx);
        }
        popListWin.setListData( Arrays.asList(AppUtils.getResource().getStringArray(R.array.bank_name)));
        popListWin.setOnSexClickListener(new PopListWin.OnSexClickListener() {
            @Override
            public void OnSexClickListener(boolean b, String sex, int index) {
                if(b){
                    bankName.setText(sex);
                }
            }
        });
        popListWin.show(bankName);
    }

    @Override
    protected int getLayoutID() {
        return R.layout.user_activity_editbankcard;
    }

    @Override
    public String getTitleName() {
        return "编辑银行卡";
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {

    }
    @Override
    public int getTitleLeftName() {
        return R.mipmap.back_click;
    }

    @Override
    public void onClickTitleLeft() {
        ActivityManager.getInstance().finishActivity();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_save, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item_sort_listview clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_save) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
